package com.yyx.app1.DiagnosticTools_function.Control.ViewPager.ViewPagerItemControl.firstControl;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yyx.app1.Data.BaseDataManager;
import com.yyx.app1.MyApp;
import com.yyx.app1.R;
import com.yyx.app1.tool.ImageTool;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by yuexing on 2015/10/14.
 */
@EViewGroup(R.layout.itemview_first_viewpager_listview)
public class ItemView_First_ViewPager_ListView extends LinearLayout {
    private Context context;

    @ViewById
    TextView itemview_first_viewpager_listview_text;

    @ViewById
    ImageView itemview_first_viewpager_listview_ico,itemview_first_viewpager_listview_icoend,frame;

    public ItemView_First_ViewPager_ListView(Context context) {
        super(context);
        this.context =context;
    }

    public ItemView_First_ViewPager_ListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context =context;
    }

    public ItemView_First_ViewPager_ListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context =context;
    }

    public void bind(String text,int drawable,int backgroud)
    {
        try {
            itemview_first_viewpager_listview_ico.setBackgroundResource(backgroud);
            itemview_first_viewpager_listview_text.setText(text);
            itemview_first_viewpager_listview_ico.setImageBitmap(BaseDataManager.getMyBaseDataManager(context).getResDrawable(
                    drawable, 0, 0));
            itemview_first_viewpager_listview_icoend.setImageBitmap(BaseDataManager.getMyBaseDataManager(context).getResDrawable(
                    R.drawable.jiantou_gray_right, itemview_first_viewpager_listview_icoend.getWidth(), itemview_first_viewpager_listview_icoend.getHeight()));
        }
        catch (Exception e)
        {
           Log.e("异常1510281103",e.toString());
        }
    }
}
